package com.example.elasticsearch.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.Map;

/**
 * @Description
 * @Author Mokairui
 * @Since 2021/11/7
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Good {
    private int id;
    private String title;
    private double price;
    private int stock;
    private int saleNum;
    private Date createTime;
    private String categoryName;
    private String brandName;
    private Map spec;

    @JSONField(serialize = false) // 在转换 JSON 时, 忽略该字段
    private String specStr; // 接收数据库的信息 "{}"
}
